<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="../lib/layui/css/layui.css" />
    <link rel="stylesheet" href="../css/borrow/borrow_list.css" />
  </head>
  <body>
    <!-- 卡片区域 -->
    <div class="layui-card">
      <div class="layui-card-header">借阅信息</div>
      <div class="layui-card-body">
        <!-- 筛选区域 -->
        <form class="layui-form" id="form-search">
          <div class="layui-form-item layui-inline">
            <label class="layui-form-label">读者姓名</label>
            <div class="layui-input-block">
              <input type="text" name="readersName"  placeholder="请输入读者姓名" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item layui-inline">
            <label class="layui-form-label">图书名称</label>
            <div class="layui-input-block">
              <input type="text" name="bookName"  placeholder="请输入图书名称" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item layui-inline">
            <button class="layui-btn layui-btn-fluid layui-btn-sm layui-btn-radius layui-btn-normal" lay-submit lay-filter="formDemo" >筛选</button>
          </div>
        </form>
        <!-- 列表区域 -->
        <table class="layui-table">
          <colgroup>
            <col />
            <col />         
            <col />
            <col />
            <col />
            <col />
            <col width="200" />
          </colgroup>
          <thead>
            <tr>
              <th>读者姓名</th>
              <th>图书名称</th>
              <th>作者名称</th>
              <th>借阅时间</th>
              <th>归还时间</th>
              <th>归还情况</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody></tbody>
        </table>
        <!-- 分页区域 -->
        <div id="pageBox"></div>
      </div>
    </div>

    <!-- 列表数据的模板引擎 -->
    <script type="text/html" id="tpl-table">
      {{each data.records}}
      <tr>
        <td>{{$value.readersName}}</td>       
        <td>{{$value.bookName}}</td>         
        <td>{{$value.bookAuthorName}}</td>
        <td>{{$value.bookBorrow}}</td>
        <td>{{$value.bookReturn}}</td>
        <td>{{$value.borrowReturn}}</td>
        <td>
          <button type="button" class="layui-btn layui-btn-radius layui-btn-warm layui-btn-xs btn-edit" data-id="{{$value.borrowShowId}}">编辑</button>
          <button type="button" class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs btn-delete" data-id="{{$value.borrowShowId}}">删除</button>
          <button type="button" class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs btn-return" data-id="{{$value.borrowShowId}}">归还</button>
        </td>
      </tr>
      {{/each}}
    </script>

    <script type="text/html" id="tpl-table">
      <option value="">归还情况</option>
      {{each data}}
      <option value="{{$value.borrowShowId}}" selected="">{{$value.borrowReturn}}</option>
      {{/each}}
    </script>


        <!-- 修改分类的弹出层 -->
        <script type="text/html" id="dialog-edit">
          <form class="layui-form" id="form-edit" lay-filter="form-edit">
            <!-- 隐藏域，保存 Id 的值 -->
            <input type="hidden" name="borrowShowId">
            <div class="layui-form-item">
              <label class="layui-form-label">读者姓名</label>
              <div class="layui-input-block">
                <input type="text" name="readersName"" required  lay-verify="required" onfocus=this.blur() placeholder="请输入读者姓名" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">图书名称</label>
              <div class="layui-input-block">
                <input type="text" name="bookName" required  lay-verify="required" placeholder="请输入图书名称" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">作者名称</label>
              <div class="layui-input-block">
                <input type="text" name="bookAuthorName" required  lay-verify="required" placeholder="请输入作者名称" autocomplete="off" class="layui-input">
              </div>
            </div>
         <div class="layui-form-item">
          <label class="layui-form-label">归还情况</label>
          <div class="layui-input-block">
            <select name="borrowReturn" lay-filter="aihao">
              <option value="未归还">未归还</option>
              <option value="已归还">已归还</option>
            </select>
          </div>
        </div>
            <div class="layui-form-item">
              <label class="layui-form-label">借阅时间</label>
              <div class="layui-input-block">
                <input type="text" name="bookBorrow" required  lay-verify="required" placeholder="请输入借阅时间" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-form-item">
              <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">确认修改</button>
              </div>
            </div>
          </form>
        </script>



       <!-- 归还图书的弹出层
       <script type="text/html" id="dialog-return">
        <form class="layui-form" id="form-return" lay-filter="form-return">
           隐藏域，保存 Id 的值 
           <input type="hidden" name="borrowShowId">
          <div class="layui-form-item">
            <label class="layui-form-label">读者姓名</label>
            <div class="layui-input-block">
              <input type="text" name="readersName" required  lay-verify="required" placeholder="请输入读者姓名" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">图书名称</label>
            <div class="layui-input-block">
              <input type="text" name="bookName" required  lay-verify="required" placeholder="请输入图书名称" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">作者名称</label>
            <div class="layui-input-block">
              <input type="text" name="bookAuthorName" required  lay-verify="required" placeholder="请输入作者名称" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <button class="layui-btn" lay-submit lay-filter="formDemo">确认归还</button>
              <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
          </div>
        </form>
      </script> -->

    <!-- 导入第三方的 JS 插件 -->
    <script src="../lib/layui/layui.all.js"></script>
    <script src="../lib/jquery.js"></script>
    <script src="../js/baseAPI.js"></script>
    <script src="../lib/template-web.js"></script>
    <!-- 导入自己的 JS 脚本 -->
    <script src="../js/borrow/borrow_list.js"></script>
  </body>
</html>
